package chapter20;

import lombok.Data;

import java.io.Serializable;

/**
 * @Description: 圆形实体类
 * @Author: cqb
 * @Date: 2020/2/22 12:59
 */
@Data
public class Circle extends GeometricObject implements Serializable {
    private double radius;

    public Circle(double radius){
        this.radius=radius;
    }

    @Override
    public double getArea() {
        return radius * radius * Math . PI;
    }

    @Override
    public double getPerimeter() {
        return 2 * radius * Math . PI;
    }

// Same as lines 3-48 in Listing 11.2, so omitted
}